package io.renren.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.renren.param.RoomSaveParam;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 会议室
 *
 * @author 1
 * @email 1@2.com
 * @date 2021-08-19 11:56:03
 */
@Data
@TableName("room")
public class RoomEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	@TableId
    private Long id;
    /**
     * 会议室名称
     */
    private String name;
    /**
     * 会议室所属的企业id
     */
    private String compId;
    /**
     * 省份
     */
    private String province;
    /**
     * 城市
     */
    private String city;
    /**
     * 会议室楼层
     */
    private String floor;
    /**
     * 会议室类型
     */
	private String type;
	/**
	 * 会议室容纳人数
	 */
	private Integer capcity;
	/**
	 * 会议室状态 unusable表示维修 usable表示可用
	 */
	private String state;
	/**
	 * 会议室设备
	 */
	private String device;
	/**
	 * ap mac
	 */
	private String apMac;
	/**
	 * 价签id
	 */
	private String eslId;

	/**
	 * 可用时段-开始
	 */
	private String validBeginHour;

    /**
     * 可用时段-结束
     */
    private String validEndHour;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;

	/**
	 * 实拍照片url
	 */
	private String picUrl;

    public static RoomEntity convertFor(RoomSaveParam param) {
        RoomEntity roomEntity = new RoomEntity();
        BeanUtils.copyProperties(param, roomEntity);
        roomEntity.setCreateTime(new Date());
        roomEntity.setUpdateTime(new Date());
        roomEntity.setCompId(param.getCorpId());
        return roomEntity;
    }

}
